<extend name="Public/detail_index"/>
<block name="pageHeader">
    <include file="Public/header.channel" channel="确认订单"/>
</block>
<block name="pageContent">
    <style>
        .list_left{width: 12em;float: left}
        .list_left img{width: 100%;}
        .list_right{position: relative;padding-left:12.5em; height: 7em}
        .list_right .text_one{
            font-size: 12px;
            color: #98a4b4;
            margin: 0 0 2px;
            line-height: 16px;
            word-break: break-all;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
        }
        .list_right .text_two{
            font-size: 12px;
            color: #98a4b4;
            margin: 0 0 2px;
            line-height: 16px;
            word-break: break-all;
            overflow: hidden;
            overflow-x: hidden;
            overflow-y: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
        }
        .list_right .text_three{
            margin: 0;
            display: inline;
            color: #f93;
            font-size: 13px;
            line-height: 20px;
            float: left;
            position: absolute;
            bottom: -3px;
            left: 11.5em;
        }
        .list_right .text_tip{
            padding: 4px;
            color: #f93;
            font-size: 12px;
            border: 1px solid #f93;
            border-radius: 2px;
            background: #fff7ef;
            position: absolute;
            bottom: 0;
            right: 0;
            margin: 0;
            line-height: 12px;
        }
        .list_right h3{font-size: 1.2em;font-weight: bold;max-height: 60px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }

        .footer .detail_ico3{padding:0.9em 0 0.8em;font-size: 1.4em; background:#1296db;color: #fff;}

        .list-box1{padding: 1em;}
        .list-box{margin-top: 0;position: relative;}


        .title-txt{font-size: 1.4em;padding: .5em 1em;background-color: #fff;}
        li.price{width: 50%;text-align: left;box-sizing: border-box;padding-left: 2em;line-height: 3.5em;font-size: 1.3em;}
    </style>
    <div class="list-box">
        <if condition="$order['type'] eq 2"> <else/>
            <div class="title-txt"> 报名人信息 <span style="float: right">{$order['ticket_name']}（{$order['ticket_phone']}）</span></div>
        </if>
            <a href="javascript:void(0);">
                <dl class="clearfix list-box1">
                    <dt class="list_left">
                        <img src="{$order.active_img}" alt="">
                    </dt>
                    <dd class="list_right">
                        <h3>
                            <span>{$order.active_name}</span>
                        </h3>
                        <if condition="$order['type'] eq 2">
                            <p class="text_one">普通用户升级为初级会员</p>
                            <else/>
                            <p class="text_one">时间：{:date('m月d日 H:i',$active['start_time'])} 开始</p>
                        </if>
                        <p class="text_three">
                            ¥{$order.active_price}
                        </p>
                    </dd>
                </dl>
            </a>
    </div>
    <if condition="$order[0]['type'] eq 2"><else/>
    <div class="title-txt"> 全票 <span style="float: right">×1 &nbsp;&nbsp;&nbsp;¥{$order['active_price']}</span></div>
    <div class="title-txt"> 支付方式 <span style="float: right">支付宝<span style="font-size: .8em;color: #aaa;">（仅支持支付宝）</span></span></div>
    </if>
    <!--脚部-->
    <div class="footer">
        <ul style="box-sizing: border-box">
            <li class="price">
                合计：¥{$order['active_price']}
            </li>

            <li style="box-sizing: border-box;border-left: solid 1px #D4D4D4;width: 50%">
                <a class="detail_ico3"  onclick="isWeiXin()"  href="javascript:void(0);">马上支付</a>
            </li>
        </ul>
    </div>
    <script>
        function isWeiXin(jump_url){
            var ua = window.navigator.userAgent.toLowerCase();
            if(ua.match(/MicroMessenger/i) == 'micromessenger'){
//               $.ajax({
//                   url:"{:U('Order/wxPay',array('sn'=>$order['order_sn'], 'open_id'=>$open_id))}",
//                   dataType:"json",
//                   type:"GET",
//                   success:function (data) {
//                       if (data.code == 1) {
//                           var pay_param = data.data;
//                           if (typeof WeixinJSBridge == "undefined"){
//                               if( document.addEventListener ){
//                                   document.addEventListener('WeixinJSBridgeReady', function () {}, false);
//                               }else if (document.attachEvent){
//                                   document.attachEvent('WeixinJSBridgeReady', function () {});
//                                   document.attachEvent('onWeixinJSBridgeReady', function () {});
//                               }
//                           }else{
//                               WeixinJSBridge.invoke(
//                                   'getBrandWCPayRequest', pay_param,
//                                   function(res){
//                                       if(res.err_msg == "get_brand_wcpay_request:ok" ) {
//                                           alert(res.result_code);
//                                           for (i in res) {
//                                               alert(i);
//                                               alert(res[i]);
//                                           }
////                                           location.href = "/index.php?s=/Order/wxPayConfirm/transaction_id/"+orderNumber;
//                                       }     // 使用以上方式判断前端返回,微信团队郑重提示：res.err_msg将在用户支付成功后返回ok，但并不保证它绝对可靠。
//                                   }
//                               );
//                           }
//                       } else {
//                           alert(data.msg);
//                       }
//                   },
//                   error:function () {
//                       alert("失败");
//                   }
//
//               });
                alert("请打开手机内置浏览器支付");
            }else{
                window.location.href="{:U('Order/alipay',array('sn'=>$order['order_sn']))}";
            }
        }
    </script>
</block>